package com.lilosoft.business.cga.service;

import com.lilosoft.business.cga.dao.EgsProjectMapper;
import com.lilosoft.business.cga.models.EgsProject;
import com.lilosoft.business.cga.models.EgsProjectExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 小峰
 * Date: 2019-08-28
 * Time: 11:29
 */
@Service
public class EgsProjectService {
    @Autowired
    private EgsProjectMapper egsProjectMapper;

    public EgsProject selectByProjectId(String projectId){
        EgsProjectExample egsProjectExample= new EgsProjectExample();
        EgsProjectExample.Criteria egsprojectCriteria = egsProjectExample.createCriteria();
        egsprojectCriteria.andProjectIdEqualTo(projectId);
        List<EgsProject> egsProjects = egsProjectMapper.selectByExample(egsProjectExample);
        if(null !=egsProjects && egsProjects.size()>0){
            return egsProjects.get(0);
        }
        return null;
    }
}
